package com.guaoran.micro.services.spring.cloud.eureka.client.user.service.consumer;

import com.guaoran.micro.services.spring.cloud.eureka.client.user.service.consumer.ribbon.FirstServerForeverRule;
import com.guaoran.micro.services.spring.cloud.feign.person.api.service.PersonService;
import com.guaoran.micro.services.spring.cloud.feign.person.api.web.WebConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;

/**
 * Person Client 应用程序
 *
 */
@SpringBootApplication
@EnableEurekaClient
@EnableFeignClients(clients = PersonService.class)
@EnableHystrix
@Import(WebConfig.class)
public class SpringCloudFeignConsumerApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpringCloudFeignConsumerApplication.class, args);
    }

    @Bean
    public FirstServerForeverRule firstServerForeverRule() {
        return new FirstServerForeverRule();
    }
}
